<!DOCTYPE HTML>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" /> 
    <title>Redis 集群中的纪元(epoch) - 天地维杰网</title>
    <meta name="keywords" content="系统架构,shutdown,不与天斗,Domino,博客,程序员,架构师,笔记,技术,分享,java,Redis">
    
    <meta property="og:title" content="Redis 集群中的纪元(epoch)">
    <meta property="og:site_name" content="天地维杰网">
    <meta property="og:image" content="/img/author.jpg"> 
    <meta name="title" content="Redis 集群中的纪元(epoch) - 天地维杰网" />
    <meta name="description" content="Redis 集群中的纪元(epoch) Redis Cluster 使用了类似于 **Raft** 算法 **term**（任期）的概念称为 **epoch**（纪元），用来给事件增加版本号。Redis 集群中的纪元主要是两种：**currentEpoch** 和 **configEpoch**。 纪元可以通过`cluster nodes`命令或`cluster info`命令查看。 `cluster nodes`返回的结果的`connected`关键字前面的数字就是实例的epoch" />
     
    <link rel="shortcut icon" href="http://www.shutdown.cn/img/favicon.ico" />
    <link rel="apple-touch-icon" href="http://www.shutdown.cn/img/apple-touch-icon.png" />
    <link rel="apple-touch-icon-precomposed" href="http://www.shutdown.cn/img/apple-touch-icon.png" />
    <link href="http://www.shutdown.cn/js/vendor/font-awesome/css/font-awesome.min.css?v=4.6.2" rel="stylesheet" type="text/css" />
    <link href="http://www.shutdown.cn/js/vendor/fancybox/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css" />
    <link href="http://www.shutdown.cn/css/main.css" rel="stylesheet" type="text/css" />
    <link href="http://www.shutdown.cn/css/syntax.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" id="hexo.configuration">
  var NexT = window.NexT || {};
  var CONFIG = {
    scheme: 'Pisces',
    sidebar: {"position":"left","display":"post"},
     fancybox: true, 
    motion: true
  };
</script>
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-7826003325059020" crossorigin="anonymous"></script>
</head>
<body itemscope itemtype="http://schema.org/WebPage" lang="zh-Hans">
<div class="container one-collumn sidebar-position-left page-home  ">
    <div class="headband"></div>

    <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"> <div class="site-meta  custom-logo ">

  <div class="custom-logo-site-title">
    <a href="http://www.shutdown.cn"  class="brand" rel="start">
      <span class="logo-line-before"><i></i></span>
      <span class="site-title">天地维杰网</span>
      <span class="logo-line-after"><i></i></span>
    </a>
  </div>
  <p class="site-subtitle">人如秋鸿来有信，事若春梦了无痕</p>
</div>

<div class="site-nav-toggle">
  <button>
    <span class="btn-bar"></span>
    <span class="btn-bar"></span>
    <span class="btn-bar"></span>
  </button>
</div>

<nav class="site-nav">
    <ul id="menu" class="menu">
      
      
        <li class="menu-item ">
          <a href="http://www.shutdown.cn/" rel="section">
              <i class="menu-item-icon fa fa-fw fa-home"></i> <br />首页
          </a>
        </li>
      
        <li class="menu-item ">
          <a href="http://www.shutdown.cn/categories/redis/" rel="section">
              <i class="menu-item-icon fa fa-fw fa-battery-full"></i> <br />Redis
          </a>
        </li>
      
        <li class="menu-item ">
          <a href="http://www.shutdown.cn/categories/java/" rel="section">
              <i class="menu-item-icon fa fa-fw fa-coffee"></i> <br />java
          </a>
        </li>
      
        <li class="menu-item ">
          <a href="http://www.shutdown.cn/categories/linux/" rel="section">
              <i class="menu-item-icon fa fa-fw fa-linux"></i> <br />linux
          </a>
        </li>
      
        <li class="menu-item ">
          <a href="http://www.shutdown.cn/categories/daily/" rel="section">
              <i class="menu-item-icon fa fa-fw fa-bug"></i> <br />日常问题
          </a>
        </li>
      
        <li class="menu-item ">
          <a href="http://www.shutdown.cn/categories/spring/" rel="section">
              <i class="menu-item-icon fa fa-fw fa-child"></i> <br />Spring和Springboot
          </a>
        </li>
      
        <li class="menu-item ">
          <a href="http://www.shutdown.cn/categories/mac/" rel="section">
              <i class="menu-item-icon fa fa-fw fa-fire"></i> <br />Mac相关
          </a>
        </li>
      
        <li class="menu-item ">
          <a href="http://www.shutdown.cn/categories/middleware/" rel="section">
              <i class="menu-item-icon fa fa-fw fa-gavel"></i> <br />中间件
          </a>
        </li>
      
        <li class="menu-item ">
          <a href="http://www.shutdown.cn/categories/jiagou/" rel="section">
              <i class="menu-item-icon fa fa-fw fa-rocket"></i> <br />架构
          </a>
        </li>
      
        <li class="menu-item ">
          <a href="http://www.shutdown.cn/categories/python/" rel="section">
              <i class="menu-item-icon fa fa-fw fa-ship"></i> <br />python
          </a>
        </li>
      
        <li class="menu-item ">
          <a href="http://www.shutdown.cn/categories/front/" rel="section">
              <i class="menu-item-icon fa fa-fw fa-bolt"></i> <br />前端
          </a>
        </li>
      
        <li class="menu-item ">
          <a href="http://www.shutdown.cn/categories/jvm/" rel="section">
              <i class="menu-item-icon fa fa-fw fa-balance-scale"></i> <br />jvm
          </a>
        </li>
      
        <li class="menu-item ">
          <a href="http://www.shutdown.cn/categories/c/" rel="section">
              <i class="menu-item-icon fa fa-fw fa-battery-empty"></i> <br />c语言
          </a>
        </li>
      
        <li class="menu-item ">
          <a href="http://www.shutdown.cn/categories/web3/" rel="section">
              <i class="menu-item-icon fa fa-fw fa-web3"></i> <br />web3
          </a>
        </li>
      
        <li class="menu-item ">
          <a href="http://www.shutdown.cn/post/" rel="section">
              <i class="menu-item-icon fa fa-fw fa-archive"></i> <br />归档
          </a>
        </li>
      
        <li class="menu-item ">
          <a href="http://www.shutdown.cn/about/" rel="section">
              <i class="menu-item-icon fa fa-fw fa-user"></i> <br />关于
          </a>
        </li>
      
      <li class="menu-item menu-item-search">
        <a href="javascript:;" class="popup-trigger"> <i class="menu-item-icon fa fa-search fa-fw"></i> <br /> 搜索</a>
      </li>
    </ul>
    <div class="site-search">
      <div class="popup">
 <span class="search-icon fa fa-search"></span>
 <input type="text" id="local-search-input">
 <div id="local-search-result"></div>
 <span class="popup-btn-close">close</span>
</div>

    </div>
</nav>

 </div>
    </header>

    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          <div id="content" class="content">
            
<section id="posts" class="posts-expand">
  <article class="post post-type-normal " itemscope itemtype="http://schema.org/Article">
    <header class="post-header">
      <h1 class="post-title" itemprop="name headline">
        <a class="post-title-link" href="http://www.shutdown.cn/post/the-epoch-in-redis-cluster/" itemprop="url">
        Redis 集群中的纪元(epoch)
        </a>
      </h1>
      <div class="post-meta">
      <span class="post-time">
<span class="post-meta-item-icon">
    <i class="fa fa-calendar-o"></i>
</span>
<span class="post-meta-item-text">时间：</span>
<time itemprop="dateCreated" datetime="2016-03-22T13:04:35+08:00" content="2022-03-28">
    2022-03-28
</time>
</span> 
      

  <span class="post-category" >
  &nbsp; | &nbsp;
  <span class="post-meta-item-icon">
    <i class="fa fa-folder-o"></i>
  </span>
  <span class="post-meta-item-text">分类：</span>
  
    <span itemprop="about" itemscope itemtype="https://schema.org/Thing">
      <a href="http://www.shutdown.cn/categories/redis" itemprop="url" rel="index">
        <span itemprop="name">redis</span>
      </a>
      &nbsp; 
    </span>
  
</span>


      
 <span>
&nbsp; | &nbsp;
<span class="post-meta-item-icon">
    <i class="fa fa-eye"></i>
</span>
<span class="post-meta-item-text">转载</span>
</span>

       <span>
&nbsp; | &nbsp;
<span class="post-meta-item-icon">
    <i class="fa fa-eye"></i>
</span>
<span class="post-meta-item-text">阅读：</span>
<span class="leancloud-visitors-count">1538 字 ~4分钟</span>
</span>
      </div>
    </header>
    <div class="post-body" itemprop="articleBody">
    
    <div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-fallback" data-lang="fallback"> 文章系转载，便于整理和分类，原文地址：https://zhuanlan.zhihu.com/p/44658603l</code></pre></div>
    

    

<p>Redis Cluster 使用了类似于 <strong>Raft</strong> 算法 <strong>term</strong>（任期）的概念称为 <strong>epoch</strong>（纪元），用来给事件增加版本号。Redis 集群中的纪元主要是两种：<strong>currentEpoch</strong> 和 <strong>configEpoch</strong>。</p>

<p>纪元可以通过<code>cluster nodes</code>命令或<code>cluster info</code>命令查看。
<code>cluster nodes</code>返回的结果的<code>connected</code>关键字前面的数字就是实例的epoch</p>
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-fallback" data-lang="fallback">[root@redis-7-221 logs]# redis-cli -p 9001 cluster nodes
37dc860d2cc031c7d0a052bb34c07ad1625cbe8f 10.4.7.222:9011 slave 335a0cb8d9d82a764a19bf71da6379b73c703e95 0 1648436204016 7 connected
5f201e00106a512ab3a3d73455ee1269b367b204 10.4.7.222:9002 master - 0 1648436205026 4 connected 4097-8192
577e5ea9c7f56c3767cfcfa23905742d97448b02 10.4.7.221:9013 master - 0 1648436206542 8 connected 8193-12288
097271ce6ad0d7c5b4e5b80a645058bd2bb0099f 10.4.7.221:9004 master - 0 1648436207048 6 connected 12289-16383
dcf4c5f00f922e67094ebd0bf0cfe61701c0c3fe 10.4.7.222:9014 slave 097271ce6ad0d7c5b4e5b80a645058bd2bb0099f 0 1648436208069 6 connected
335a0cb8d9d82a764a19bf71da6379b73c703e95 10.4.7.221:9001 myself,master - 0 0 1 connected 0-4096</code></pre></div>
<p><code>cluster info</code>命令返回的  <code>cluster_current_epoch</code>为集群最大的epoch纪元值，<code>cluster_my_epoch</code>为实例的纪元值。</p>
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-fallback" data-lang="fallback">[root@redis-7-221 logs]# redis-cli -p 9001 cluster info
cluster_state:ok
cluster_slots_assigned:16384
cluster_slots_ok:16384
cluster_slots_pfail:0
cluster_slots_fail:0
cluster_known_nodes:10
cluster_size:4
cluster_current_epoch:9
cluster_my_epoch:1
cluster_stats_messages_sent:233871
cluster_stats_messages_received:53172</code></pre></div>
<h2 id="currentepoch"><strong>currentEpoch</strong></h2>

<p>这是一个集群状态相关的概念，可以当做记录集群状态变更的递增版本号。每个集群节点，都会通过 server.cluster-&gt;currentEpoch 记录当前的 <strong>currentEpoch</strong>。</p>

<p>集群节点创建时，不管是 <strong>master</strong> 还是 <strong>slave</strong>，都置 <strong>currentEpoch</strong> 为 0。当前节点接收到来自其他节点的包时，如果发送者的 <strong>currentEpoch</strong>（消息头部会包含发送者的 <strong>currentEpoch</strong>）大于当前节点的<strong>currentEpoch</strong>，那么当前节点会更新 <strong>currentEpoch</strong> 为发送者的 <strong>currentEpoch</strong>。因此，集群中所有节点的 <strong>currentEpoch</strong> 最终会达成一致，相当于对集群状态的认知达成了一致。</p>

<h2 id="currentepoch-作用"><strong>currentEpoch 作用</strong></h2>

<p><strong>currentEpoch</strong> 作用在于，当集群的状态发生改变，某个节点为了执行一些动作需要寻求其他节点的同意时，就会增加 <strong>currentEpoch</strong> 的值。目前 <strong>currentEpoch</strong> 只用于 <strong>slave</strong> 的故障转移流程，这就跟哨兵中的sentinel.current_epoch 作用是一模一样的。当 <strong>slave A</strong> 发现其所属的 <strong>master</strong> 下线时，就会试图发起故障转移流程。首先就是增加 <strong>currentEpoch</strong> 的值，这个增加后的 <strong>currentEpoch</strong> 是所有集群节点中最大的。然后<strong>slave A</strong> 向所有节点发起拉票请求，请求其他 <strong>master</strong> 投票给自己，使自己能成为新的 <strong>master</strong>。其他节点收到包后，发现发送者的 <strong>currentEpoch</strong> 比自己的 <strong>currentEpoch</strong> 大，就会更新自己的 <strong>currentEpoch</strong>，并在尚未投票的情况下，投票给 <strong>slave A</strong>，表示同意使其成为新的 <strong>master</strong>。</p>

<h2 id="configepoch"><strong>configEpoch</strong></h2>

<p>这是一个集群节点配置相关的概念，每个集群节点都有自己独一无二的 configepoch。所谓的节点配置，实际上是指节点所负责的槽位信息。</p>

<p>每一个 <strong>master</strong> 在向其他节点发送包时，都会附带其 <strong>configEpoch</strong> 信息，以及一份表示它所负责的 <strong>slots</strong> 信息。而 <strong>slave</strong> 向其他节点发送包时，其包中的 <strong>configEpoch</strong> 和负责槽位信息，是其 <strong>master</strong> 的 <strong>configEpoch</strong> 和负责的 <strong>slot</strong> 信息。节点收到包之后，就会根据包中的 <strong>configEpoch</strong> 和负责的 <strong>slots</strong> 信息，记录到相应节点属性中。</p>

<h2 id="configepoch-作用"><strong>configEpoch 作用</strong></h2>

<p><strong>configEpoch</strong> 主要用于解决不同的节点的配置发生冲突的情况。举个例子就明白了：节点A 宣称负责 <strong>slot 1</strong>，其向外发送的包中，包含了自己的 <strong>configEpoch</strong> 和负责的 <strong>slots</strong> 信息。节点 C 收到 A 发来的包后，发现自己当前没有记录 <strong>slot 1</strong> 的负责节点（也就是 server.cluster-&gt;slots[1] 为 NULL），就会将 A 置为 <strong>slot 1</strong> 的负责节点（server.cluster-&gt;slots[1] = A），并记录节点 A 的 <strong>configEpoch</strong>。后来，节点 C 又收到了 B 发来的包，它也宣称负责 <strong>slot 1</strong>，此时，如何判断 <strong>slot 1</strong> 到底由谁负责呢？</p>

<p>这就是 <strong>configEpoch</strong> 起作用的时候了，C 在 B 发来的包中，发现它的 <strong>configEpoch</strong>，要比 A 的大，说明 B 是更新的配置。因此，就将 <strong>slot 1</strong> 的负责节点设置为 B（server.cluster-&gt;slots[1] = B）。在 <strong>slave</strong> 发起选举，获得足够多的选票之后，成功当选时，也就是 <strong>slave</strong> 试图替代其已经下线的旧 <strong>master</strong>，成为新的 <strong>master</strong> 时，会增加它自己的 <strong>configEpoch</strong>，使其成为当前所有集群节点的 <strong>configEpoch</strong> 中的最大值。这样，该 <strong>slave</strong> 成为 <strong>master</strong> 后，就会向所有节点发送广播包，强制其他节点更新相关 <strong>slots</strong> 的负责节点为自己。</p>

<h2 id="参考资料"><strong>参考资料</strong></h2>

<ol>
<li><a href="https://link.zhihu.com/?target=https%3A//redis.io/topics/cluster-spec">Redis Cluster Specification</a></li>
<li><a href="https://link.zhihu.com/?target=https%3A//redis.io/topics/cluster-tutorial">Redis cluster tutorial</a></li>
<li><a href="https://link.zhihu.com/?target=https%3A//www.cnblogs.com/leeSmall/p/8414687.html">Redis系列九：redis集群高可用</a></li>
<li><a href="https://link.zhihu.com/?target=https%3A//www.cnblogs.com/gqtcgq/p/7247042.html">Redis源码解析：27集群(三)主从复制、故障转移</a></li>
</ol>

<h2 id="license"><strong>License</strong></h2>

<ol>
<li>封面图片 Photo by<strong><a href="https://link.zhihu.com/?target=https%3A//unsplash.com/photos/lCTP4TlF_ic%3Futm_source%3Dunsplash%26utm_medium%3Dreferral%26utm_content%3DcreditCopyText">Andrew Haimerl</a></strong></li>
<li>遵守创作共享 <strong><a href="https://link.zhihu.com/?target=https%3A//creativecommons.org/licenses/by-nc-sa/3.0/cn/">CC BY-NC-SA 3.0协议</a></strong></li>
</ol>

    </div>
    <footer class="post-footer">
     
 
<div class="post-tags">     
     
    <a href="http://www.shutdown.cn/tags/redis" rel="tag" title="redis">#redis#</a>
    
    <a href="http://www.shutdown.cn/tags/epoch" rel="tag" title="epoch">#epoch#</a>
    
    <a href="http://www.shutdown.cn/tags/cluster" rel="tag" title="cluster">#cluster#</a>
    
    <a href="http://www.shutdown.cn/tags/raft" rel="tag" title="raft">#raft#</a>
    
    <a href="http://www.shutdown.cn/tags/%e7%ba%aa%e5%85%83" rel="tag" title="纪元">#纪元#</a>
    
</div>



     <div class="post-nav">
    <div class="post-nav-next post-nav-item">
    
        <a href="http://www.shutdown.cn/post/cluster-confusion-troubleshooting-caused-by-the-instance-cluster-status-of-fail/" rel="next" title="实例集群状态为Fail导致的集群混乱排查和复现">
        <i class="fa fa-chevron-left"></i> 实例集群状态为Fail导致的集群混乱排查和复现
        </a>
    
    </div>

    <div class="post-nav-prev post-nav-item">
    
        <a href="http://www.shutdown.cn/post/redis-shake-data-sync-and-transfer/" rel="prev" title="redis-shake数据同步与迁移工具">
        redis-shake数据同步与迁移工具 <i class="fa fa-chevron-right"></i>
        </a>
    
    </div>
</div>
      
     
     
     






    </footer>
  </article>
</section>

          </div>
        </div>
        <div class="sidebar-toggle">
  <div class="sidebar-toggle-line-wrap">
    <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
    <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
    <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
  </div>
</div>
<aside id="sidebar" class="sidebar">
  <div class="sidebar-inner">

  <ul class="sidebar-nav motion-element">
    <li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap" >
      文章目录
    </li>
    <li class="sidebar-nav-overview" data-target="site-overview">
      站点概览
    </li>
  </ul>

    <section class="site-overview sidebar-panel ">
      <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
    <img class="site-author-image" itemprop="image"
        src="http://www.shutdown.cn/img/author.jpg"
        alt="不与天斗Domino" />
    <p class="site-author-name" itemprop="name">不与天斗Domino</p>
    <p class="site-description motion-element" itemprop="description"> 
        Programmer &amp; Architect</p>
</div>
      <nav class="site-state motion-element">
    <div class="site-state-item site-state-posts">
      <a href="http://www.shutdown.cn/post/">
        <span class="site-state-item-count">183</span>
        <span class="site-state-item-name">日志</span>
      </a>
    </div>
    <div class="site-state-item site-state-categories">    
        <a href="http://www.shutdown.cn/categories/">      
         
        <span class="site-state-item-count">15</span>
        
        <span class="site-state-item-name">分类</span>
        
        </a>
    </div>

    <div class="site-state-item site-state-tags">
        <a href="http://www.shutdown.cn/tags/">
         
        <span class="site-state-item-count">224</span>
        
        <span class="site-state-item-name">标签</span>
        </a>
    </div>
</nav>
      
      

      

      <div class="links-of-blogroll motion-element inline">
<script type="text/javascript" src="//rf.revolvermaps.com/0/0/8.js?i=&amp;m=0&amp;s=220&amp;c=ff0000&amp;cr1=ffffff&amp;f=arial&amp;l=33&amp;bv=35" async="async"></script>
</div>

    </section>
    
<section class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active">
    <div class="post-toc">
        <div class="post-toc-content"><nav id="TableOfContents">
<ul>
<li>
<ul>
<li><a href="#currentepoch"><strong>currentEpoch</strong></a></li>
<li><a href="#currentepoch-作用"><strong>currentEpoch 作用</strong></a></li>
<li><a href="#configepoch"><strong>configEpoch</strong></a></li>
<li><a href="#configepoch-作用"><strong>configEpoch 作用</strong></a></li>
<li><a href="#参考资料"><strong>参考资料</strong></a></li>
<li><a href="#license"><strong>License</strong></a></li>
</ul></li>
</ul>
</nav></div>
    </div>
</section>

  </div>
</aside>

      </div>
    </main>
   
    <footer id="footer" class="footer">
      <div class="footer-inner">
        <div class="copyright" >
  <span itemprop="copyrightYear">  &copy; 
  2013 - 2023</span>
  <span class="with-love"><i class="fa fa-heart"></i></span>
  <span class="author" itemprop="copyrightHolder">天地维杰网</span>
  <span class="icp" itemprop="copyrightHolder"><a href="https://beian.miit.gov.cn/" target="_blank">京ICP备13019191号-1</a></span>
</div>
<div class="powered-by">
  Powered by - <a class="theme-link" href="http://gohugo.io" target="_blank" title="hugo" >Hugo v0.63.2</a>
</div>
<div class="theme-info">
  Theme by - <a class="theme-link" href="https://github.com/xtfly/hugo-theme-next" target="_blank"> NexT
  </a>
</div>


      </div>
    </footer>

    <div class="back-to-top">
      <i class="fa fa-arrow-up"></i>
      <span id="scrollpercent"><span>0</span>%</span>
    </div>
  </div>

  

<script type="text/javascript">
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>
<script type="text/javascript" src="http://www.shutdown.cn/js/vendor/jquery/index.js?v=2.1.3"></script>
<script type="text/javascript" src="http://www.shutdown.cn/js/vendor/fastclick/lib/fastclick.min.js?v=1.0.6"></script> 
<script type="text/javascript" src="http://www.shutdown.cn/js/vendor/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script>
<script type="text/javascript" src="http://www.shutdown.cn/js/vendor/velocity/velocity.min.js?v=1.2.1"></script>
<script type="text/javascript" src="http://www.shutdown.cn/js/vendor/velocity/velocity.ui.min.js?v=1.2.1"></script>
<script src="http://www.shutdown.cn/js/vendor/ua-parser-js/dist/ua-parser.min.js?v=0.7.9"></script>

<script src="http://www.shutdown.cn/js/vendor/fancybox/jquery.fancybox.pack.js?v=2.1.5"></script>

<script type="text/javascript" src="http://www.shutdown.cn/js/utils.js"></script>
<script type="text/javascript" src="http://www.shutdown.cn/js/motion.js"></script>
<script type="text/javascript" src="http://www.shutdown.cn/js/affix.js"></script>
<script type="text/javascript" src="http://www.shutdown.cn/js/schemes/pisces.js"></script>

<script type="text/javascript" src="http://www.shutdown.cn/js/scrollspy.js"></script>
<script type="text/javascript" src="http://www.shutdown.cn/js/post-details.js"></script>
<script type="text/javascript" src="http://www.shutdown.cn/js/toc.js"></script>

<script type="text/javascript" src="http://www.shutdown.cn/js/bootstrap.js"></script>

<script type="text/javascript" src="http://www.shutdown.cn/js/search.js"></script>
<script type="text/x-mathjax-config">
  MathJax.Hub.Config({
    extensions: ["tex2jax.js"],
    jax: ["input/TeX", "output/HTML-CSS"],
    tex2jax: {
      inlineMath: [ ['$','$'] ],
      displayMath: [ ['$$','$$'] ],
      processEscapes: true
    },
    "HTML-CSS": { fonts: ["TeX"] }
  });
</script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-AMS-MML_HTMLorMML' async></script>
</body>
</html>